import asyncio
import logging

import cmd_arg
from config.settings import Settings
from spider.bqg import NovelsCrawler,NovelCrawler

# Configure logging
logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
)

async def main():

    await cmd_arg.parse_cmd()
    if Settings.NOVELS:
        crawler = NovelsCrawler()
    else:
        # TODO 输入 --novel 小说标题 而不是链接
        crawler = NovelCrawler(Settings.NOVEL)
    await crawler.start()

if __name__ == '__main__':
    asyncio.run(main())